package com.atguigu.gulimall.product;

import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
* 1,整合Mybatis-plus
 *  1）导入依赖
 *          <dependency>
 *             <groupId>com.baomidou</groupId>
 *             <artifactId>mybatis-plus-boot-starter</artifactId>
 *             <version>3.2.0</version>
 *         </dependency>
*  2）配置
 *         1》配置数据源
 *              1>导入数据库驱动
 *              2>在application。yml中配置数据源相关信息
 *              spring:
 *              datasource:
 *                  username: root 账号
 *                  password: root 密码
 *                  url: jdbc:mysql://192.168.56.10:3306/gulimall_pms 数据库地址
 *                  driver-class-name: com.mysql.cj.jdbc.Driver 驱动类名
 *         2》配置MyBatis-Plus
 *              1>使用@MapperScan注解扫描dao包中的内容，好像是类似通用mapper中mapper接口继承Mapper类泛型实体类
 *              2>告诉MyBatis-Plus，sql映射文件位置
 *              mybatis-plus.mapper-locations: classpath:/mapper/** /*.xm（此处不应有空格）
 *              使用了类似通用mapper 所以还要添加mabatis-plus中的id type 选择auto自增规则
 */
@MapperScan("com.atguigu.gulimall.product.dao")
@SpringBootApplication
@EnableDiscoveryClient
public class GulimallProductApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallProductApplication.class, args);
    }

}
